package com.jiaai.shop.util;

import com.jiaai.shop.store.entity.SSystemconfig;
import com.jiaai.shop.store.service.ISSystemconfigService;

/**
 * Created by Administrator on 2018\5\5 0005.
 */
public class CacheManage {
    private static SSystemconfig systemconfig;

    public  static SSystemconfig  getSystemConfig(){
        if(systemconfig==null){
            systemconfig=SpringUtil.getBean(ISSystemconfigService.class).selectOne(null);
        }
        return systemconfig;
    }

    public synchronized  static void  updateSystemConfig(SSystemconfig config){
        SSystemconfig systemconfig=getSystemConfig();
        systemconfig.setExtractProportion(config.getExtractProportion());
        systemconfig.setRecommendInter(config.getRecommendInter());
    }
}
